import service from "./request";

const request = function () {};

request.post = function (url, params) {
  return new Promise((resolve, reject) => {
    service
      .post(url, params)
      .then(function (res) {
        resolve(res.data);
      })
      .catch((res) => {
        reject(res.data);
      });
  });
};

request.get = function (url, params) {
  return new Promise((resolve, reject) => {
    service
      .get(url, {            
        params: params        
    })
      .then(function (res) {
        resolve(res.data);
      })
      .catch((res) => {
        reject(res.data);
      });
  });
};

export default request;
